package com.weiaibenpao.demo.chislim.presenter;

import com.weiaibenpao.demo.chislim.base.BasePresenter;
import com.weiaibenpao.demo.chislim.bean.MallBean;
import com.weiaibenpao.demo.chislim.retrofit.RetrofitUtils;
import com.weiaibenpao.demo.chislim.retrofit.rx.NetWorkTransformer;
import com.weiaibenpao.demo.chislim.retrofit.rx.SimpleObserver;
import com.weiaibenpao.demo.chislim.view.DjqMallView;

/**
 * Created by wlx on 2017/12/13.
 */

public class DjqMallPresenter extends BasePresenter<DjqMallView> {
    public void getDjqMall(int page,int size){
        RetrofitUtils.getAPIService().getDjqMall(page,size).
                compose(new NetWorkTransformer<MallBean>()).
                subscribe(new SimpleObserver<MallBean>(mCompositeDisposable) {
                    @Override
                    public void call(MallBean mallBean) {
                        getView().djqMallSuccess(mallBean);
                    }
                });
    }
}
